//
//  BeautyModel.swift
//  TestModelActor
//
//  Created by rolodestar on 2025/6/18.
//

import SwiftData
import Foundation

typealias BeautyModel = BeautyModelV1

@Model class BeautyModelV1{
    
    var id: UUID
    var remoteUrl: URL
    var localUrl: URL?
    var status: BeautyModel.DownloadStatus
    init(id: UUID = UUID(), remoteUrl: URL, localUrl: URL? = nil, status: BeautyModel.DownloadStatus = .notStart) {
        self.id = id
        self.remoteUrl = remoteUrl
        self.localUrl = localUrl
        self.status = status
    }
    
}

extension BeautyModel{
    enum DownloadStatus:Equatable,Codable{
        case notStart
        case downloading(progress: Double)
        case completed
        case pause(resumeData: Data?)
        case fail(errorMsg: String)
    }
}
